package com.example.recruit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.recruit.dto.EmployerCompany;
import com.example.recruit.dto.JobAll;
import com.example.recruit.entity.Employer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author HUAWEI
 */
@Mapper
@Repository
public interface EmployerMapper extends BaseMapper<Employer> {
    /**
     * 通过id查询管理员和公司
     */
    @Select("SELECT employer.id ,employer.name,employer.phone,employer.avatar,employer.company_id,company.company_name,company.address,company.image,company.count\n" +
            "FROM employer,company where employer.id=#{id} AND employer.company_id=company.id"
    )
    EmployerCompany getEmployerAllById(String id);

    @Select("SELECT employer.id ,employer.name,employer.phone,employer.avatar,employer.company_id,company.company_name,company.address,company.image,company.count\n" +
            "FROM employer,company where employer.company_id=company.id")
    List<EmployerCompany> getEmployerAllList();


}
